package pcsr.drivers.nxtDriver;

import pcsr.drivers.nxtDriver.command.NXTCommand;

class NXTActuatorFactory {

	enum NXTActuatorFactoryType {
		MotorActuator,
		LightActuator
	}

	NXTActuatorFactory( )
	{}

	public INXTActuator createActuator( NXTPort actuator, NXTActuatorFactoryType actuatorType ) {
		switch (actuatorType) {
		case MotorActuator:
			return new NXTMotorActuator(actuator, NXTCommand.GetSingleton());
		case LightActuator:
			return new NXTLightActuator(actuator, NXTCommand.GetSingleton());
		}
		throw new IllegalArgumentException("The actuator type " + actuatorType + " is not recognized.");
	}
}
